package com.ott.tool;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JOptionPane;

public class startTomcat implements ActionListener {
	
	
	@Override
	public void actionPerformed(ActionEvent e) {
		int ifadd = JOptionPane.showConfirmDialog(null, "确定吗？", "提示！", JOptionPane.YES_NO_OPTION);
		if (ifadd == JOptionPane.YES_OPTION) {
			
			IndexForm.textArea.append("==========启动tomcat脚本开始执行=========\r\n");
			//启动tomcat
			try {
//				Boolean flag = (new StartAndStopTomcat()).execShell(IndexForm.tomcatpath+"bin/startup.bat");
				Boolean flag = (new ExecShell()).execShell(IndexForm.shellPathString+"startTomcat.sh");
				if(flag){
					IndexForm.textArea.append("==========启动tomcat脚本执行成功=========\r\n");
				}else{
					IndexForm.textArea.append("==========启动tomcat脚本执行失败=========\r\n");
				}
			} catch (Exception e2) {
				IndexForm.textArea.append("==========启动tomcat脚本执行失败=========\r\n"+e2);
				return;
			}
			
		}
	}

}
